
struct PARAMS_IN
{
    float4 wPos : SV_Position;
    [[vk::location(0)]] float2 vTex : MY_TEX;
};

struct PARAMS_OUT
{
    float4 k_color : SV_Target;
};

SamplerState g_samBack : register(s0, space1);
Texture2D g_texBack : register(t0, space2);
RWTexture2D<uint> g_txtID : register(u1, space2);

void main( PARAMS_IN pIn, out PARAMS_OUT pOut )
{
    pOut.k_color = g_texBack.Sample(g_samBack, pIn.vTex);

    uint2 rc = (uint2)pIn.wPos.xy;
    uint2 size;
    g_txtID.GetDimensions(size.x, size.y);
    rc = min(rc, size-1);
    g_txtID[rc] = rc.x;
}

